
#ifndef __ADS_H__5493594859430534_0y690890254093265
#define __ADS_H__5493594859430534_0y690890254093265

#include "M051Series.h"

/*----------------*/
/* Standard types */
/*----------------*/

typedef unsigned int        uint32;
typedef unsigned short      uint16;
typedef unsigned char       uint8;

#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long int




typedef unsigned char  BOOLEAN;         
typedef unsigned char  INT8U;          /* Unsigned  8 bit quantity */
typedef signed   char  INT8S;          /* Signed    8 bit quantity */
typedef unsigned short INT16U;         /* Unsigned 16 bit quantity */
typedef signed   short INT16S;         /* Signed   16 bit quantity */
typedef unsigned int   INT32U;         /* Unsigned 32 bit quantity */
typedef signed   int   INT32S;         /* Signed   32 bit quantity */


typedef int		INT;
typedef unsigned int	UINT;

typedef unsigned char	UCHAR;
typedef unsigned char	BYTE;

typedef short		SHORT;
typedef unsigned short	USHORT;
typedef unsigned short	WORD;

typedef long		LONG;
typedef unsigned long	ULONG;
typedef unsigned long	DWORD;


#ifndef NULL
   #define NULL (0)
#endif

#ifndef BOOL
	#define BOOL  unsigned char
#endif
#ifndef TRUE
	#define TRUE                1
#endif
#ifndef FALSE
	#define FALSE               0
#endif

#define SETB(val,mark)		(val |= mark)
#define CLRB(val,mark)		(val &= (~mark))

#define IsBitHigh(val,mask)  ((val&mask)==mask)

//////////////////////////////////////////////////////////////////////////////

#define MAKEWORD(a,b)            ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))
#define MAKEDWORD(a,b)           ((DWORD)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
#define MAKELONG(a0,a1,a2,a3)    MAKEDWORD(MAKEWORD(a0,a1),MAKEWORD(a2,a3))

#define LOWORD(l)           ((WORD)(l))
#define HIWORD(l)           ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w)           ((BYTE)(w))
#define HIBYTE(w)           ((BYTE)(((WORD)(w) >> 8) & 0xFF))

#define U32_HIGHEST_U8(dw)		((BYTE)((dw>>24)&0xFF))  
#define U32_HIGH_U8(dw)			((BYTE)((dw>>16)&0xFF))
#define U32_LOW_U8(dw)			((BYTE)((dw>>8)&0xFF))
#define U32_LOWEST_U8(dw)		((BYTE)(dw&0xFF))

//////////////////////////////////////////////////////////////////////////


#endif /* ADSh */
